<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./../template.xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns="http://www.w3.org/1999/xhtml" >

    <ui:define name="content">
        <h:panelGrid width="100%">
            <f:facet name="header">Seleção de usuários</f:facet>
        </h:panelGrid>

        <h:form>
            <h:panelGrid width="100%" class="direita">
                <h:column>
                    <h:commandButton value="Novo" action="novo" />
                    <h:commandButton value="Pesquisar" action="usuario" />
                </h:column> 
            </h:panelGrid>
        </h:form>
        <h:panelGrid width="100%">
            <h:dataTable value="#{usuarioController.mostraTodos()}" var="umUsuario" width="100%" id="tabelaSel">
                <h:column>
                    <h:form>
                        <h:commandLink value="Editar" action="editar">
                            <f:setPropertyActionListener value="#{umUsuario}" target="#{usuarioController.usuario}"/>
                        </h:commandLink>
                    </h:form>
                </h:column>
                <h:column>
                    <f:facet name="header">
                        <h:outputText value="Código"/>
                    </f:facet>
                    #{umUsuario.id}
                </h:column>
                <h:column>
                    <f:facet name="header">
                        <h:outputText value="Nome"/>
                    </f:facet>
                    #{umUsuario.nome}
                </h:column>
                <h:column>
                    <f:facet name="header">
                        <h:outputText value="Login"/>
                    </f:facet>
                    #{umUsuario.login}
                </h:column>
                <h:column>
                    <f:facet name="header">
                        <h:outputText value="Password"/>
                    </f:facet>
                    #{umUsuario.password}
                </h:column>
                <h:column>
                    <f:facet name="header">
                        <h:outputText value="Permissão"/>
                    </f:facet>
                    #{umUsuario.permissao}
                </h:column>

            </h:dataTable> 
        </h:panelGrid>
    </ui:define>

</ui:composition>
